In [1]:
%pylab inline

from mpl_toolkits.mplot3d import * #3D-s ábrák alcsomagja
from ipywidgets import *  #interaktivitáshoz szükséges függvények

#from IPython.core.display import HTML
Populating the interactive namespace from numpy and matplotlib

Tight-binding calculation for s-like bands in square lattice

$E(\mathbf{k})=E_s -\gamma \left[\cos(k_x a)+\cos(k_y a) \right]$

wave number $k$ in units of $1/a$, where $a$ is the lattice constant.

In [2]:
# Az abra kimentesehez az alabbiakat a plt.show()  ele kell tenni!!! 

#savefig('fig_rainbow_p2_1ray.pdf');  # Abra kimentese
#savefig('fig_rainbow_p2_1ray.eps');  n# Abra kimentese

# Abra es fontmeretek
xfig_meret= 8   #    12 nagy abrahoz
yfig_meret= 8    #   12 nagy abrahoz
xyticks_meret= 15  #  20 nagy abrahoz
xylabel_meret= 20  #  30 nagy abrahoz
legend_meret= 21   #  30 nagy abrahoz
In [3]:
def en_sq(kx,ky,params):
    # s-like bands tight binding calculation for square lattice
    
    E0, gamma = params
    
    tmp=E0-gamma*(cos(kx)+cos(ky))
    return (tmp)

Special points in the Brilloiun zone of the square lattice:

In [4]:
Npoints=50
E0 = 1
gamma=0.5
params= [E0,gamma]

kx,ky = meshgrid(linspace(-pi,pi,Npoints),linspace(-3,3,50)) #mintavételezési pontok legyártása
en = en_sq(kx,ky,params)          #függvény kiértékelés
In [5]:
figsize(xfig_meret,yfig_meret)

figsize(10,10)

subplot(1,1,1,aspect='equal')

contourf(kx,ky,en,levels=linspace(0,2.0,27))
colorbar();
In [6]:
ncont = 17  # a contour-vonalak szama, pl. ncont = 11

figsize(xfig_meret,yfig_meret)
subplot(1,1,1,aspect='equal')

cp=contour(kx, ky, en, ncont, alpha=1, colors='blue', linestyles='-',linewidths=2)
clabel(cp, inline=True,  fontsize=10);
In [7]:
cs=contour(kx,ky,en,levels=[0.0,0.1,0.5,1.,1.2,1.5,1.9])
clabel(cs);
In [8]:
figsize(xfig_meret,yfig_meret)
figsize(8,8)

ax = subplot(111, projection='3d')
ax.plot_surface(kx, ky, en,rstride=1,cstride=1,cmap='viridis')
ax.set_xlabel('$k_x$',labelpad=5,fontsize=20)
ax.set_ylabel('$k_y$',labelpad=5,fontsize=20)
ax.set_zlabel('$E(\mathbf{k})$',labelpad=5,fontsize=20)
show();
In [ ]: